package main

import (
    "facecat"
    "io/ioutil"
)

var gPaint = facecat.CreatePaint()

func WndProc(hwnd facecat.HWND, msg uint32, wParam, lParam uintptr) (result uintptr) {
    return facecat.WndProcDefault(gPaint, hwnd, msg, wParam, lParam)
}

func main() {
    facecat.CreateMainWindow(gPaint, "FaceCat-Go", WndProc)
    xmlStr, _ := ioutil.ReadFile("xml//layoutdivexample.xml")
    facecat.RenderFaceCat(gPaint, string(xmlStr))
    tabPage := facecat.FindViewByName("TabPage2", gPaint.Views)
    layoutDiv := facecat.CreateView("layout")
    layoutDiv.Location = facecat.CreatePoint(50, 50)
    layoutDiv.Size = facecat.CreateSize(250, 100)
    layoutDiv.ShowHScrollBar = true
    facecat.AddViewToParent(layoutDiv, tabPage)
    for i := 0; i < 10; i++{
        button := facecat.CreateView("button")
        button.Location = facecat.CreatePoint(0, 0)
        button.Size = facecat.CreateSize(100, 49)
        facecat.AddViewToParent(button, layoutDiv)
        button.Text = "Button"
    }
    facecat.ResetLayoutDiv(layoutDiv)
    facecat.ShowWindow(gPaint)
}